import $http from '../../../servers/http';
import { Result } from '../../schema/Result';
/* 系统配置-白名单管理
---------------------------------------------------------------- */
import { WhiteListInfo, GetWhiteListRequest } from '../../schema/WhiteList';
/**新增白名单 */
export const createWhiteList = (data: WhiteListInfo): Promise<any> => {
  return $http.post({
    url: '/icms/whiteListManage/whiteLists',
    data,
  });
};

/**删除白名单 */
export const deleteWhiteList = (id: number): Promise<Result<null>> => {
  return $http.delete({
    url: `/icms/whiteListManage/whiteLists/${id}`,
  });
};
/**批量删除白名单 */
export const mulDelWhiteList = (data: number[]): Promise<Result<null>> => {
  return $http.delete({
    url: '/icms/whiteListManage/whiteLists',
    data: { whiteListIds: data },
  });
};
/**查询白名单列表 */
export const getWhiteLists = (data: GetWhiteListRequest): Promise<Result<WhiteListInfo[]>> => {
  return $http.get({
    url: '/icms/whiteListManage/whiteLists',
    data,
  });
};
